<template>
	<div class="index">
		this is index	
		<router-link to="www.baidu.com" tag="div">
			<a>链接</a>
		</router-link>
		{{author}}<br>
		<hr>
		<p>vuex测试</p>
		<p>{{testCount}}</p>
		<button @click="addNum">更新vuex</button>
		<hr>
		<Menu></Menu>	
	</div>
</template>


<script>

import Menu from '@/components/Menu';
import {mapState,mapGetters} from 'vuex'
export default {
	name: 'Index',
	components: {
		Menu
	},
	data() {
		return {

		}
	},
	computed: {
		...mapState(['testCount']),
		author() {
			console.log(111)
			return this.$store.state.author;
		}
	},
	mounted() {
		console.log(this)
	},
	methods: {
		addNum() {
			this.$store.commit('increment',{
				num: 30
			})
		}
	}
}
	
</script>


<style lang="less">
	
</style>